package com.example.boot.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 脱敏注解，标记在需要脱敏的字段上
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
//@JsonSerialize(using = DesensitizeSerializer.class) // 指定自定义序列化器
@JsonSerialize(using = DynamicDesensitizeSerializer.class) // 指定自定义序列化器，支持通过 application.yaml 动态指定脱敏规则
public @interface Desensitize {
    /**
     * 脱敏类型
     */
    DesensitizeType value();
}
